// filename: MainDialog.cpp
// author: enic
// date: 2015-11-05

#pragma once

#include "LoginDialog.h"

namespace DuiLib
{
	DUI_BEGIN_MESSAGE_MAP(LoginDialog, WindowImplBase)
		//DUI_ON_MSGTYPE(DUI_MSGTYPE_WINDOWINIT, OnWindowInitialized)
		DUI_ON_MSGTYPE_CTRNAME(DUI_MSGTYPE_CLICK, _T("loginBtn"), OnBtnLogin)
		//DUI_ON_MSGTYPE(DUI_MSGTYPE_TEXTCHANGED,OnTextChanged)
	DUI_END_MESSAGE_MAP()

	LoginDialog::LoginDialog()
	{
	}

	LoginDialog::~LoginDialog()
	{
	}

	LPCTSTR LoginDialog::GetWindowClassName() const
	{
		return _T("TeamTalkMainDialog");
	}

	CDuiString LoginDialog::GetSkinFile()
	{
		return _T("LoginDialog.xml");
	}

	CDuiString LoginDialog::GetSkinFolder()
	{
		return _T("");
	}

	CControlUI* LoginDialog::CreateControl(LPCTSTR pstrClass)
	{
		return NULL;
	}

	void LoginDialog::InitWindow()
	{
	}

	void LoginDialog::InitControls()
	{
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_ptxtTip, _T("tipText"), CTextUI);
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pedtUserName, _T("edit_name"), CEditUI);
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pedtPassword, _T("edit_pwd"), CEditUI);
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pBtnLogin, _T("loginBtn"), CButtonUI);
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pBtnSysSetting, _T("setting"), CButtonUI);
		X_DUI_FIND_CONTROL_FROM_PM(m_PaintManager, m_pChkRememberPWD, _T("isRememberPWD"), CCheckBoxUI);
	}

	void LoginDialog::OnFinalMessage(HWND hWnd)
	{
	}

	void LoginDialog::OnBtnLogin(TNotifyUI& msg)
	{
		Close(IDCANCEL);
	}
}


